package com.codehelper;

public class TemplateFileInfo {
    public String templateName;
    public String packageName;
    public String genFilePath;

    private String filePatten;

    public String fileExt=".java";

    private TemplateFileInfo(String templateName, String packageName, String genFilePath, String filePatten,String fileExt) {
        this.templateName = templateName;
        this.packageName = packageName;
        this.genFilePath = genFilePath;
        this.filePatten = filePatten;
        this.fileExt=fileExt;
    }

    public static TemplateFileInfo javaFile(String templateName, String packageName, String genFilePath,String filePatten) {
        TemplateFileInfo fileInfo=new TemplateFileInfo(templateName,packageName,genFilePath,filePatten,".java");
        return fileInfo;
    }

    public static TemplateFileInfo otherFile(String templateName,  String genFilePath,String filePatten,String fileExt) {
        TemplateFileInfo fileInfo=new TemplateFileInfo(templateName,"",genFilePath,filePatten,fileExt);
        return fileInfo;
    }



    public String getFileName(String entityName){
        return this.filePatten.replace("{entity}",entityName).replace("{templateName}",this.templateName);
    }
}
